import React, { Component } from 'react'
import propTypes from 'prop-types'
import './style.css'

export class Navbar extends Component {
  render() {
    const { children } = this.props

    return (
      <div className="nav-bar">
        <div className="left">{children}</div>
        <div className="left">{children[0]}</div>
        <div className="content">{children[1]}</div>
        <div className="right">{children[2]}</div>
      </div>
    )
  }
}

Navbar.propTypes = {
  // 如果插槽只有一个：对象
  // children: propTypes.element,
  // 如果插槽是多个：数组
  children: propTypes.array,
}

export default Navbar
